<?php

    require_once('../modele/Utilisateur.class.php');
    require_once('../acces_donnees/AccesDonneesProjet.class.php');
    require_once('../acces_donnees/AccesDonneesActivite.class.php');
    require_once('../acces_donnees/AccesDonneesTache.class.php');
    require_once('../modele/Projet.class.php');
    require_once('../modele/Activite.class.php');
    require_once('../modele/Tache.class.php');
    
    session_start();
    
    if (!empty($_SESSION['utilisateur']) && !empty($_POST['nom_tache']) && !empty($_POST['date_creation_tache'])
        && !empty($_POST['date_echeance_tache']))
    {
        $tache = new Tache($_POST['id_tache'], $_POST['date_creation_tache'], $_POST['date_echeance_tache'],
                           $_POST['nom_tache'], $_POST['statut_tache'], $_POST['lien_activite_tache']);
        
        $activite = new Activite($_POST['lien_activite_tache']);
        $accesTache = new AccesDonneesTache($tache, $_SESSION['utilisateur'], $activite);
        $etatModificationTache = $accesTache->miseAJour();
        
        $_SESSION['etatGestionTache'] = $etatModificationTache;
        header('Location: c_racine.php?page=gestion_tache');
    }
?>
